package com.dh.teacher;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test {
    public static void main(String[] args) {
        //AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(BaseConfig.class);
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("aopdemo.xml");
        MathTeacher mathTeacher = context.getBean("mathTeacher", MathTeacher.class);
        EnglishTeacher englishTeacher= (EnglishTeacher) context.getBean("englishTeacher");
        String res1= mathTeacher.teach(1);
        System.out.println(res1);
        String res2 = englishTeacher.teach(2);
        System.out.println(res2);
    }
}
